﻿
/**
 *  Projeto de Compiladores 
 *  Centro de Informática - CIn UFPE
 *
 *  Equipe: Djaci Alves         - daaf
 *          Phillip César       - pcas
 *			Lais  Neves         - lmn3
 *          Thiago Nascimento   - tasn
 *
 *  DSL para a criação de aplicações MHP Java para TV digital.
 */

// Código gerado automaticamente pelo gerador de código do TVDesigner.
// Não alterar!

using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Drawing;
using System.Collections;

using GCParseElements = TVDesigner.Generator.ParseElements;
using GCHScreen = TVDesigner.Generator.Components.Screen;
using GCHIcon = TVDesigner.Generator.Components.HIcon;
using GCHButton = TVDesigner.Generator.Components.HButton;
using GCHText = TVDesigner.Generator.Components.HText;
using ImageFile = TVDesigner.Generator.ImageFile;

namespace TVDesigner
{
    static class TVDesigner1
    {   
        /// <summary>
        /// The main entry point for the application.
        /// </summary> 
        [STAThread]
        static void Main()
        {
            GCHScreen startPoint = null;
			GCHScreen componentScreen = null;
			
			GCHButton hb = null;
			GCHIcon hi = null;
			GCHText ht = null;
			ImageFile imageFile = null;
						
            List<GCHScreen> screens = new List<GCHScreen>();
            List<ImageFile> imageFiles = new List<ImageFile>();   
                  
        	        
	        
	        //------------- Inicializando o HScreen "HScreen1". ------------------------
			componentScreen = new GCHScreen();			
			componentScreen.Name = "HScreen1";
			componentScreen.Location = new Point(0, 0);
			componentScreen.Size = new Size(720 , 576);
			componentScreen.Visible = false;
			
			componentScreen.ScreenRed =  "HScreen2"; 												
		        
	        //Incializando o botão "HButton1" dentro da tela "HScreen1".
			hb = new GCHButton();			
			hb.Name = "HButton1";
			hb.Location = new Point(10, 10);
			hb.Size = new Size(0, 0);
			hb.Visible = true;
			hb.Text = "Button1";
			hb.Focusable = true;
									    
		    imageFile = new ImageFile(@"C:\Documents and Settings\Djaci Filho\Desktop\bNormal.PNG");
		    hb.Image = imageFile.FileNameWithExtension;
		    imageFiles.Add(imageFile);
		    imageFile = null;
									    
		    imageFile = new ImageFile(@"C:\Documents and Settings\Djaci Filho\Desktop\bSelecao.PNG");
		    hb.SelectedImage = imageFile.FileNameWithExtension;
		    imageFiles.Add(imageFile);
		    imageFile = null;
						
			componentScreen.Components.Add(hb);
		        
	        //Incializando o botão "HButton2" dentro da tela "HScreen1".
			hb = new GCHButton();			
			hb.Name = "HButton2";
			hb.Location = new Point(10, 50);
			hb.Size = new Size(0, 0);
			hb.Visible = true;
			hb.Text = "Button2";
			hb.Focusable = true;
						
			hb.HScreenName = "HScreen2";
									    
		    imageFile = new ImageFile(@"C:\Documents and Settings\Djaci Filho\Desktop\bNormal.PNG");
		    hb.Image = imageFile.FileNameWithExtension;
		    imageFiles.Add(imageFile);
		    imageFile = null;
									    
		    imageFile = new ImageFile(@"C:\Documents and Settings\Djaci Filho\Desktop\bSelecao.PNG");
		    hb.SelectedImage = imageFile.FileNameWithExtension;
		    imageFiles.Add(imageFile);
		    imageFile = null;
						
			componentScreen.Components.Add(hb);
		        
	        //Incializando o botão "HButton3" dentro da tela "HScreen1".
			hb = new GCHButton();			
			hb.Name = "HButton3";
			hb.Location = new Point(10, 90);
			hb.Size = new Size(0, 0);
			hb.Visible = true;
			hb.Text = "";
			hb.Focusable = true;
									    
		    imageFile = new ImageFile(@"C:\Documents and Settings\Djaci Filho\Desktop\bNormal.PNG");
		    hb.Image = imageFile.FileNameWithExtension;
		    imageFiles.Add(imageFile);
		    imageFile = null;
									    
		    imageFile = new ImageFile(@"C:\Documents and Settings\Djaci Filho\Desktop\bSelecao.PNG");
		    hb.SelectedImage = imageFile.FileNameWithExtension;
		    imageFiles.Add(imageFile);
		    imageFile = null;
						
			componentScreen.Components.Add(hb);
		        
		
		

			//Adicionando a tela "HScreen1".
			screens.Add(componentScreen);
			        
	        
	        //------------- Inicializando o HScreen "HScreen2". ------------------------
			componentScreen = new GCHScreen();			
			componentScreen.Name = "HScreen2";
			componentScreen.Location = new Point(0, 0);
			componentScreen.Size = new Size(720 , 576);
			componentScreen.Visible = false;
			
															
		        
				
			//Incializando a imagem "HImage1" dentro da tela "HScreen2".
			hi = new GCHIcon();
			hi.Name = "HImage1";
			hi.Location = new Point(400, 400);
			hi.Size = new Size(0, 0);
			hi.Visible = true;
			hi.Focusable = false;
						    
		    imageFile = new ImageFile(@"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg");
		    hi.Image = imageFile.FileNameWithExtension;
		    imageFiles.Add(imageFile);
		    imageFile = null;
						
			componentScreen.Components.Add(hi);
		
				
			//Incializando o htext "HLabel2" dentro da tela "HScreen2".
			ht = new GCHText();
			ht.Name = "HLabel2";
			ht.Location = new Point(10, 10);
			ht.Size = new Size(200, 100);
			ht.Visible = true;
			ht.Focusable = false;
			ht.Text = "Label da HScreen2";
			ht.Foreground = Color.FromArgb(-16777216);
			ht.Background = Color.FromArgb(-16744193);
			componentScreen.Components.Add(ht);
		

			//Adicionando a tela "HScreen2".
			screens.Add(componentScreen);
		
        
            string startPointName = "HScreen1";
			foreach (GCHScreen s in screens)
			{
			    if (s.Name.Equals(startPointName))
			    {			    
			        startPoint = s;
			        break;
			    }
			}
            
            GCParseElements pe = new GCParseElements(startPoint, screens, imageFiles);         


			//----------------- Criando a tela da aplicação ------------------------------
			// Aki eh onde o form é criado e aparece na tela para que o usuário configure algumas
			// informações.

			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			TVDesigner.Gui.FMain main = new TVDesigner.Gui.FMain();
			
			//Atribuindo os elementos que vão ser parseados ao FMain.			
			main.ParseElements = pe; 		
			
			Application.Run(main);
		}
	}
}


		